﻿using System;
using System.Collections.Generic;
using System.IO;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal class Feat11RgInvalidCells
    {
        private List<Feat11CellStruct> rgCellInvalid;


        public void Read(BinaryReader reader)
        {
            var cCellInvalid = reader.ReadUInt16();
            this.rgCellInvalid = new List<Feat11CellStruct>
                ();
            for (int i = 0; i < cCellInvalid; i++)
            {
                var item = new Feat11CellStruct();
                item.Read(reader);
                this.rgCellInvalid.Add(item);
            }
        }

        public void Write(BinaryWriter writer)
        {
            ushort cCellInvalid = (ushort) rgCellInvalid.Count;
            writer.Write(cCellInvalid);
            foreach (var item in rgCellInvalid)
                item.Write(writer);
        }
    }
}